package unamur.iodass.app;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;


public class ProjectProperties {
	
	private static final String FICHIER_PROPERTIES = "/ressources/property.properties";
	private static Properties properties;
	
	public ProjectProperties(){
        InputStream propertiesFile = Properties.class.getResourceAsStream( FICHIER_PROPERTIES );
		properties= new Properties();
		
		if ( propertiesFile == null ) {
            System.err.println( "Le fichier properties " + FICHIER_PROPERTIES + " est introuvable." );
        }

        try {
            properties.load( propertiesFile );
        } catch ( IOException e ) {
        	System.err.println( "Impossible de charger le fichier properties " + FICHIER_PROPERTIES );
        }

	}
	
	public static String getProjectProperty(String property){
		return properties.getProperty(property);
	}
}
